<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>fetch使用</title>
</head>
<body>
    <ul>
        <li></li>
        <li></li>
    </ul>
    <script>
        let html = '';
        let ul = document.querySelector('ul');

        async function getData() {
            let response = await fetch('http://youyong.ba:8080/mock/609a94bd9fdbd7143b8d6737/aa/test');
            let res = await response.json();
            console.log(res, '<----');
            for (let i=0; i<res.data.length; i++) {
                html+= `<li>${res.data[i].title}</li>`;
            }
            ul.innerHTML = html;
        }

        getData();
        
    </script>
</body>
</html>